package com.qms.repast.weidgets.common;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * @author 泅渡者
 * @date 2018/9/17 0017
 * @describe:
 */
public class MyGrideView extends GridView {
	public MyGrideView (Context context) {
		super(context);
	}

	public MyGrideView (Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public MyGrideView (Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
	}


	/**
	 * 只重写该方法，达到使ListView适应ScrollView的效果
	 */
	@Override
	protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec) {
		int expandSpec = MeasureSpec.makeMeasureSpec(
				Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
		super.onMeasure(widthMeasureSpec, expandSpec);
	}
}
